bitkeeper revision 1.1159.189.6 (41a4df56fjKgjR75gUVniMEBSnS-9Q)
authorcl349@arcadians.cl.cam.ac.uk <cl349@arcadians.cl.cam.ac.uk>
Wed, 24 Nov 2004 19:21:58 +0000 (19:21 +0000)
committercl349@arcadians.cl.cam.ac.uk <cl349@arcadians.cl.cam.ac.uk>
Wed, 24 Nov 2004 19:21:58 +0000 (19:21 +0000)
Unlock biglock on hypercall preemption.

xen/arch/x86/memory.c
xen/arch/x86/traps.c
xen/include/xen/sched.h

index 4068583821cf942330f5eb2650858f27bc7b3295..b62f9c37e088d47e4aad3160bdc731e11019dfdc 100644 (file)
@@ -1307,7 +1307,7 @@ int do_mmu_update(mmu_update_t *ureqs, int count, int *success_count)
 
     for ( i = 0; i < count; i++ )
     {
-        hypercall_may_preempt(
+        locked_hypercall_may_preempt(d,
             __HYPERVISOR_mmu_update, 3, ureqs, count-i, success_count);
 
         if ( unlikely(__copy_from_user(&req, ureqs, sizeof(req)) != 0) )
index c3a6453e7ea1167c1aa1daa937149629dfda8fc6..ca69d6589fcce1d3e982c9c1e99c5f8165d173bd 100644 (file)
@@ -814,7 +814,8 @@ long do_set_trap_table(trap_info_t *traps)
 
     for ( ; ; )
     {
-        hypercall_may_preempt(__HYPERVISOR_set_trap_table, 1, traps);
+        locked_hypercall_may_preempt(current->domain,
+                                     __HYPERVISOR_set_trap_table, 1, traps);
 
         if ( copy_from_user(&cur, traps, sizeof(cur)) ) return -EFAULT;
 
index 9224699445bfb717e0e8cff8d07421ff54c7359c..d69e3bf40efe67f8e76529ef6d81c8798f401daa 100644 (file)
@@ -263,6 +263,13 @@ void hypercall_create_continuation(unsigned int op, unsigned int nr_args, ...);
             hypercall_create_continuation(_op , _nr_args , ##_args); \
             return _op;                                              \
     } } while ( 0 )
+#define locked_hypercall_may_preempt(_d, _op, _nr_args, _args...)    \
+    do {                                                             \
+        if ( unlikely(softirq_pending(smp_processor_id())) ) {       \
+            hypercall_create_continuation(_op , _nr_args , ##_args); \
+            UNLOCK_BIGLOCK(_d);                                      \
+            return _op;                                              \
+    } } while ( 0 )
 
 /* This domain_hash and domain_list are protected by the domlist_lock. */
 #define DOMAIN_HASH_SIZE 256